const tbody = document.querySelector("#shop-tbody")
getData()
function getData() {
	utils.fetch('./api/shop/select.php').then(resp => {
		if (resp.code ===200){
			const{ list } = resp.body
			let html = ""
			list.forEach((shop, index) => {
				html +=`
				<tr data-id="${shop.id}">
					<td>${index + 1}</td>
					<td><span>${shop.name}</span> <input class="inputName" type="text"></td>
					<td><span>${shop.price}</span> <input class="inputPrice" type="text"></td>
					<td><span>${shop.num}</span> <input class="inputNum" type="text"></td>
					<td>
					<button class="btn btn-xs btn-info btn-edit">编辑</button>
					<button  class="btn btn-xs btn-warning btn-del">删除</button>
					<button  class="btn btn-xs btn-danger btn-cancel"> 取消</button>
					<button  class="btn btn-xs btn-success btn-ok">确定</button>
					</td>
				</tr>
				`
			})
			tbody.innerHTML = html
		}
	})
}